package iqq.ui.view.panel.login;

import iqq.common.IQQConstants;
import iqq.util.ImageManager;
import iqq.util.ImageUtils;
import iqq.util.NinePatchUtils;

import java.awt.BorderLayout;
import java.awt.Dimension;

import javax.swing.ImageIcon;
import javax.swing.border.EmptyBorder;

import com.alee.laf.label.WebLabel;
import com.alee.laf.panel.WebPanel;

/**
 * @author ChenZhiHui
 * @create-time 2013-3-8
 */
public class HeaderPl extends WebPanel {

	private static final long serialVersionUID = 8338906594198364183L;

	private WebLabel faceLbl;
	private WebLabel shadowLbl;

	public HeaderPl() {
		super(new BorderLayout());
		initComponent();
	}

	/**
	 * initialization component
	 */
	private void initComponent() {
		ImageIcon ImgIcon = ImageManager.getImageIcon(IQQConstants.ICON_DEF_QQ);
		faceLbl = new WebLabel(ImageUtils.getScaledInstance(ImgIcon, 100, 100));
		faceLbl.setMargin(20, 20, 10, 20);
		add(faceLbl, BorderLayout.CENTER);

		shadowLbl = new WebLabel();
		shadowLbl.setPreferredSize(new Dimension(this.getWidth(), 20));
		shadowLbl.setPainter(NinePatchUtils
				.getNinePatchIconPainter(IQQConstants.NP_SHADOW_LINE));
		add(shadowLbl, BorderLayout.PAGE_END);
	}

}
